import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/mybar',
    redirect :'/house'
  },
  {
    path: '/',
    redirect :'/house'
  },{
    path: '/mybar',
    name: 'mybar',
    component: () => import('../views/myBar.vue'),
    children:[{
      path: '/course',
      name: 'course',
      component: () => import('../views/course/Course.vue'),
    },{
      path: '/booking',
      name: 'booking',
      component: () => import('../views/booking/Booking.vue'),
    },{
      path: '/practice',
      name: 'practice',
      component: () => import('../views/practice/Practice.vue'),
    },{
      path: '/user',
      name: 'user',
      component: () => import('../views/user/User.vue'),
    },{
      path: '/house',
      name: 'house',
      component: () => import('../views/home/House.vue')
    }]
  },{
    path: '/bookdetail',
    name: 'bookdetail',
    component: () => import('../views/home/bookDetail.vue'),
  },{
    path: '/teachdetail',
    name: 'teachdetail',
    component: () => import('../views/home/teachDetail.vue'),
  }
]

const router = new VueRouter({
  routes
})

export default router
